<?php

	include "../conf/config.php";
	$result = mysql_connect($host,$granted_user,$granted_mdp)or die("impossible de se connecter"); 
	$result = mysql_select_db($db_name)or die("ne peut selectioner DB");

	if (!$result) {
 		$message  = 'Requête invalide : ' . mysql_error() . "\n";
		$message .= 'Requête complète : ' . $query;
		die($message);
		echo $message;
	}

	if (isset($_GET['id'])) {

		$id = $_GET['id'] ;

		$sql = "SELECT FROM user WHERE id_user=".$id.";";
		$result = mysql_query($sql);


		if ($result != 'false')
		{			
			//echo $id;

			$sql = "DELETE FROM evo WHERE id_user=".$id.";";
			//echo $sql;

			$query = mysql_query($sql);
			//echo $query;

			$sql = "DELETE FROM user WHERE id_user=".$id.";";
			//echo $sql;

			$query = mysql_query($sql);
			//echo $query;
		}
	}
	echo mysql_error();
	$_SESSION['user']['message'] = "Utilisateur supprimé.";
	header('Location: index.php');

?>